Skip to content

Fix/8544 mac linux unprivileged reenroll#9603

Closed
kaanyalti wants to merge 8 commits intoelastic:mainfrom
kaanyalti:fix/8544_mac_linux_unprivieged_reenroll_discovery
Closed

Fix/8544 mac linux unprivileged reenroll#9603
kaanyalti wants to merge 8 commits intoelastic:mainfrom
kaanyalti:fix/8544_mac_linux_unprivieged_reenroll_discovery

Conversation

@kaanyalti
Copy link
Copy Markdown

@kaanyalti kaanyalti commented Aug 27, 2025

  • Bug

What does this PR do?

Updates the enroll command so that the file permissions are fixed when a privileged user executes it on an unprivileged agent. Implemented only for mac/linux. Windows implementation will be in a follow up pr as it will be a bit more involved.

Why is it important?

Currently a root user needs to run sudo -u elastic-agent-user elastic-agent enroll ... in order to re-enroll an unprivileged agent.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

None

How to test this PR locally

  • Build the agent
  • Install and enroll with --unprivileged flag
  • Execute enroll as root
  • Verify that agent is still healthy

Related issues

@kaanyalti kaanyalti added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-active-all Automated backport with mergify to all the active branches labels Aug 27, 2025
@kaanyalti kaanyalti force-pushed the fix/8544_mac_linux_unprivieged_reenroll_discovery branch from 83cf268 to b62e62a Compare August 27, 2025 16:47
@kaanyalti kaanyalti changed the title Fix/8544 mac linux unprivieged reenroll discovery Fix/8544 mac linux unprivileged reenroll discovery Aug 27, 2025
@kaanyalti kaanyalti force-pushed the fix/8544_mac_linux_unprivieged_reenroll_discovery branch from b62e62a to dcf303a Compare August 27, 2025 16:52
@kaanyalti kaanyalti force-pushed the fix/8544_mac_linux_unprivieged_reenroll_discovery branch from dcf303a to b716e9f Compare August 27, 2025 16:55
@kaanyalti kaanyalti changed the title Fix/8544 mac linux unprivileged reenroll discovery Fix/8544 mac linux unprivileged reenroll Aug 27, 2025
@kaanyalti kaanyalti closed this Aug 27, 2025
@kaanyalti kaanyalti deleted the fix/8544_mac_linux_unprivieged_reenroll_discovery branch August 27, 2025 17:20
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Aug 27, 2025

⚠️ The sha of the head commit of this PR conflicts with #9604. Mergify cannot evaluate rules on this PR. ⚠️

@kaanyalti
Copy link
Copy Markdown
Author

changed branch name, automatically closed.

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Aug 27, 2025

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @kaanyalti

@elastic-sonarqube
Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
26.1% Coverage on New Code (required ≥ 40%)

See analysis details on SonarQube

@karenzone karenzone mentioned this pull request Sep 16, 2025
ebeahan added a commit that referenced this pull request Sep 17, 2025
ebeahan added a commit that referenced this pull request Sep 18, 2025
* update changelog for 9.1.4

* relocate

* Remove PR links from changelog entries

* Update release notes for version 9.1.4

* remove PR #9603

---------

Co-authored-by: Colleen McGinnis <colleen.mcginnis@elastic.co>
Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
mergify Bot pushed a commit that referenced this pull request Sep 18, 2025
* update changelog for 9.1.4

* relocate

* Remove PR links from changelog entries

* Update release notes for version 9.1.4

* remove PR #9603

---------

Co-authored-by: Colleen McGinnis <colleen.mcginnis@elastic.co>
Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
(cherry picked from commit 6cda380)
colleenmcginnis pushed a commit that referenced this pull request Sep 18, 2025
* update changelog for 9.1.4

* relocate

* Remove PR links from changelog entries

* Update release notes for version 9.1.4

* remove PR #9603

---------



(cherry picked from commit 6cda380)

Co-authored-by: Eric Beahan <eric.beahan@elastic.co>
Co-authored-by: Colleen McGinnis <colleen.mcginnis@elastic.co>
Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
intxgo pushed a commit to intxgo/elastic-agent that referenced this pull request Sep 24, 2025
* update changelog for 9.1.4

* relocate

* Remove PR links from changelog entries

* Update release notes for version 9.1.4

* remove PR elastic#9603

---------



(cherry picked from commit 6cda380)

Co-authored-by: Eric Beahan <eric.beahan@elastic.co>
Co-authored-by: Colleen McGinnis <colleen.mcginnis@elastic.co>
Co-authored-by: Pierre HILBERT <pierre.hilbert@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants